class CreateNewArticles < ActiveRecord::Migration
  def self.up
    ActiveRecord::Base.transaction do
      create_table :articles do |t|
        t.column :title, :string
        t.column :body, :text
        t.column :created_at, :datetime
        t.column :updated_at, :datetime
        t.column :replied_at, :datetime
        t.column :user_id, :integer
        t.column :discipline_id, :integer 
      end

      foreign_key :articles, :user_id, :users
      foreign_key :articles, :discipline_id, :disciplines
    end
  end

  def self.down
    drop_table :articles
  end
end
